package com.memory.spring_0829;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@Slf4j
public class Spring0829Application {

	public static void main(String[] args) {
		ConfigurableApplicationContext ctx = SpringApplication.run(Spring0829Application.class, args);
		long start = System.currentTimeMillis();

		long time = (System.currentTimeMillis() - start) / 1000;
		String info = "启动完成，耗时%d秒，swagger访问链接：http://%s:%s%s/doc.html";
		String address = ctx.getEnvironment().getProperty("server.address");
		String port = ctx.getEnvironment().getProperty("server.port");
		String path = ctx.getEnvironment().getProperty("server.servlet.context-path");
		log.info(String.format(info, time, address, port, path));
	}

}
